package com.sh.threadmethod.threadmethod;

/**
 * @Auther: sh
 * @Version 1.0
 * @Description:
 */
public class YieldMethod implements Runnable {


    public static void main(String[] args) {
        new Thread(new YieldMethod(), "Thread-A").start();
        new Thread(new YieldMethod(), "Thread-B").start();
    }
    @Override
    public void run() {
        System.out.println(Thread.currentThread().getName() + " 进入run方法");
//        Thread.yield();
        System.out.println(Thread.currentThread().getName() + " 退出run方法");
    }
}

